package com.yh.entity;

import java.text.SimpleDateFormat;
import java.util.Date;

import org.apache.naming.java.javaURLContextFactory;

import com.sun.jmx.snmp.Timestamp;

public class User {

	private int u_id;
	private String username;
	private String userrealname;
	private String userpwd;
	private String usersex;
	private Date userbirth;
	private String birth;
	private String userid_num;
	private String useremail;
	private String userphone;
	private String userrole;
	public User() {
		super();
		// TODO 自动生成的构造函数存根
	}
	
	public User(String username, String userrealname, String usersex,
			String useremail, String userphone) {
		super();
		this.username = username;
		this.userrealname = userrealname;
		this.usersex = usersex;
		this.useremail = useremail;
		this.userphone = userphone;
	}
    
	
	public User(int u_id, String username, String userrealname, String userpwd,
			String usersex, Date userbirth, String birth, String userid_num,
			String useremail, String userphone, String userrole) {
		super();
		this.u_id = u_id;
		this.username = username;
		this.userrealname = userrealname;
		this.userpwd = userpwd;
		this.usersex = usersex;
		this.userbirth = userbirth;
		this.birth = birth;
		this.userid_num = userid_num;
		this.useremail = useremail;
		this.userphone = userphone;
		this.userrole = userrole;
	}

	public int getU_id() {
		return u_id;
	}

	public void setUid(int uid) {
		this.u_id = u_id;
	}

	public String getUsername() {
		return username;
	}

	public void setUsername(String username) {
		this.username = username;
	}

	public String getUserrealname() {
		return userrealname;
	}

	public void setUserrealname(String userrealname) {
		this.userrealname = userrealname;
	}

	public String getUserpwd() {
		return userpwd;
	}

	public void setUserpwd(String userpwd) {
		this.userpwd = userpwd;
	}

	public String getUsersex() {
		return usersex;
	}

	public void setUsersex(String usersex) {
		this.usersex = usersex;
	}

	public Date getUserbirth() {
		
		return userbirth;
	}

	public void setUserbirth(Date userbirth) {
		this.userbirth = userbirth;
	}

	public String getBirth() {
		SimpleDateFormat sdf = new SimpleDateFormat("yyyy-HH-dd HH:mm:ss");
		if(this.userbirth != null){
			return sdf.format(userbirth);
		}
		return "";
	}

	public void setBirth(String birth) {
		this.birth = birth;
	}

	public String getUserid_num() {
		return userid_num;
	}

	public void setUserid_num(String userid_num) {
		this.userid_num = userid_num;
	}

	public String getUseremail() {
		return useremail;
	}

	public void setUseremail(String useremail) {
		this.useremail = useremail;
	}

	public String getUserphone() {
		return userphone;
	}

	public void setUserphone(String userphone) {
		this.userphone = userphone;
	}

	public String getUserrole() {
		return userrole;
	}

	public void setUserrole(String userrole) {
		this.userrole = userrole;
	}

}
